
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>html按钮下拉菜单</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900|RobotoDraft:400,100,300,500,700,900|Material+Icons'>
<style>
/* 第二步：css样式 */
body {
  background: #F5F5F5;
  height: 100%;
  color: rgba(0, 0, 0, 0.87);
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 按钮样式 */
.btn {
  outline: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: #FF6600;
  min-width: 260px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  padding: 16px 20px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  overflow: hidden;
  cursor: pointer;
}
.btn:focus .dropdown, .btn:active .dropdown {
  transform: translate(0, 20px);
  opacity: 1;
  visibility: visible;
}
.btn .material-icons {
  border-radius: 100%;
}
.btn .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #FFFFFF;
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
}
.btn .dropdown:before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20px;
  width: 0;
  height: 0;
  box-shadow: 2px -2px 6px rgba(0, 0, 0, 0.05);
  border-top: 6px solid #FFFFFF;
  border-right: 6px solid #FFFFFF;
  border-bottom: 6px solid transparent;
  border-left: 6px solid transparent;
  transform: rotate(-45deg);
  mix-blend-mode: multiple;
}
.btn .dropdown li {
  z-index: 1;
  position: relative;
  background: #FFFFFF;
  padding: 0 20px;
  color: #666;
}
.btn .dropdown li.active {
  color: #FF6600;
}
.btn .dropdown li:first-child {
  border-radius: 4px 4px 0 0;
}
.btn .dropdown li:last-child {
  border-radius: 0 0 4px 4px;
}
.btn .dropdown li:last-child a {
  border-bottom: 0;
}
.btn .dropdown a {
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 0;
  color: inherit;
  font-size: 10px;
  text-decoration: none;
}
</style>
</head>
<body>
<!-- 第一步：html菜单布局 -->
<div class="container">
  <button class="btn"><span>个人中心</span>
    <i class="material-icons">more</i>
    <ul class="dropdown">
      <li class="active"><a href="#">个人信息</a></li>
      <li><a href="#">更改密码</a></li>
      <li><a href="#">帮助</a></li>
      <li><a href="#">退出</a></li>
    </ul>
  </button>
</div> 
</body>
</html>
